Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken deserialization for inputs and InputMaps #622

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

Shute052
Copy link
Collaborator

@Shute052 Shute052 commented Sep 10, 2024

  • Fixed the broken deserialization that caused by Refactor UserInput into Buttonlike, Axislike and DualAxislike #548
  • Moved #[serde_typetag] attribute of inputs to correct places
  • Changed RegisterUserInput extension for App
  • Removed unnessary ser/de and reflect impls for UserInput
  • Added a custom MapRegistry that allows multiple deserializer registration
  • Added regression tests for ser/de of inputs and InputMaps

/// let mut app = App::new();
/// app.register_user_input::<MouseScrollAlwaysFiveOnYAxis>();
/// ```
pub trait UserInput:
Copy link
Collaborator Author

@Shute052 Shute052 Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add a detailed example.rs for this. This doc example isn't enough for creating a custom UserInput

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

@Shute052 Shute052 added the bug Something isn't working label Sep 10, 2024
@alice-i-cecile alice-i-cecile merged commit cd50ba1 into Leafwing-Studios:main Sep 10, 2024
4 checks passed
@Shute052 Shute052 deleted the fix-serde branch September 10, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants